/*************************************************************************
	> File Name: Algorithm.h
	> Author: 
	> Mail: 
	> Created Time: 2021年12月22日 星期三 15时25分40秒
 ************************************************************************/

#ifndef _WMARK_ALGORITHM_H
#define _WMARK_ALGORITHM_H

#include <WatermarkManager.h>
#include <watermark_common.h>
#include "AlgorithmModule.h"
#include "Algorithm.h"
#define WM_IMAGE_W 2000
#define WM_IMAGE_H 600
#define RGB_CHANNEL 4
namespace camera {
namespace algorithm {

class WMarkAlgorithm : public Algorithm , public WaterMarkResult{

public:
    WMarkAlgorithm();
    ~WMarkAlgorithm();
    int handle(algorithm_info_t info);
    int handleStr(algorithm_info_t info);
    int handleLog(algorithm_info_t info);


private:
    std::mutex watermark_mtx;
    std::mutex watermarkLog_mtx;
    int displayX, displayY, displayLogX, displayLogY;
    int watermark_w, watermark_h, watermarkLog_w, watermarkLog_h;
    int mAppLogoCameraId, mAppStrCameraId;
    int mEnableStr, mEnableImg;
    int log_channel;
    unsigned char image[WM_IMAGE_H][WM_IMAGE_W];
    unsigned char logImage[WM_IMAGE_H * WM_IMAGE_W * RGB_CHANNEL];
    StrBgColor mStrBgColor;
    int mMultiChannelDisplay = 0;
    void onWaterMarkResult(WaterMarkImage wMarkImage);
    void onWaterMarkLogResult(WaterMarkImage wMarkImage);
    bool isEnableWmark(string halCameraId, int appCameraId, int enbale);
};

} // algorithm
} // camera
#endif
